/**
 * 
 * 广州锐鹏计算机科技有限公司（www.ruipengkj.com）
 * 
 * 
 * Copyright (c) 2011-2012 RUIPENGKJ.Co.Ltd. All rights reserved.
 * 
 * */
package com.ruipengkj.bean;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * 说明：
 * Entity Name 供货商单
 * @Author：李智深
 * @Date：2012-03-14
 */
@Entity
@Table(name="ruipeng_tb_TSupplier")
public class TSupplier implements Serializable{

	private static final long serialVersionUID = 1L;
	
	private String SupplierID;//供货商编号CHAR(15)PK
	
	private int TotalNum;//总采购数量INTEGER
	
	private double TotalMoney;//总采购金额DECIMAL(20,3)
	
	private String Name;//供货商名称VARCHAR(100)

	private String Address;//地址VARCHAR(256)

	private String Mobile;//手机VARCHAR(30)

	private String Phone;//固定电话

	private String Remark;//备注VARCHAR(512)
	
	private int Priority;//供货商评级INTEGER

	private String Operator;//创建人CHAR(15)

	private Date HappenTime;//创建时间DATETIME

	private boolean IsValid;//是否有效boolean

	private String Contact;//联系人VARCHAR(20)
	
	private Set<TPurchase> TPurchases=new HashSet<TPurchase>(0);//采购

	public TSupplier(){};
	
	public TSupplier(String supplierID) {
		super();
		SupplierID = supplierID;
	}

	public TSupplier(String name, String mobile, String phone, String contact) {
		super();
		Name = name;
		Mobile = mobile;
		Phone = phone;
		Contact = contact;
	}

	@Id
	@Column(name = "SupplierID", length=15)
	public String getSupplierID() {
		return SupplierID;
	}

	public void setSupplierID(String supplierID) {
		SupplierID = supplierID;
	}

	@Column(name = "TotalNum")
	public int getTotalNum() {
		return TotalNum;
	}

	public void setTotalNum(int totalNum) {
		TotalNum = totalNum;
	}

	@Column(name = "TotalMoney", precision = 20, scale = 3)
	public double getTotalMoney() {
		return TotalMoney;
	}

	public void setTotalMoney(double totalMoney) {
		TotalMoney = totalMoney;
	}

	@Column(name = "Name", length=100)
	public String getName() {
		return Name;
	}

	public void setName(String name) {
		Name = name;
	}

	@Column(name = "Address", length=256)
	public String getAddress() {
		return Address;
	}

	public void setAddress(String address) {
		Address = address;
	}

	@Column(name = "Mobile", length=30)
	public String getMobile() {
		return Mobile;
	}

	public void setMobile(String mobile) {
		Mobile = mobile;
	}

	@Column(name = "Phone", length=30)
	public String getPhone() {
		return Phone;
	}

	public void setPhone(String phone) {
		Phone = phone;
	}

	@Column(name = "Remark", length=512)
	public String getRemark() {
		return Remark;
	}

	public void setRemark(String remark) {
		Remark = remark;
	}

	@Column(name = "Priority")
	public int getPriority() {
		return Priority;
	}

	public void setPriority(int priority) {
		Priority = priority;
	}

	@Column(name = "Operator", length=15)
	public String getOperator() {
		return Operator;
	}

	public void setOperator(String operator) {
		Operator = operator;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "HappenTime", nullable = false, length = 19)
	public Date getHappenTime() {
		return HappenTime;
	}

	public void setHappenTime(Date happenTime) {
		HappenTime = happenTime;
	}

	@Column(name = "IsValid")
	public boolean isIsValid() {
		return IsValid;
	}

	public void setIsValid(boolean isValid) {
		IsValid = isValid;
	}

	@Column(name = "Contact", length=20)
	public String getContact() {
		return Contact;
	}

	public void setContact(String contact) {
		Contact = contact;
	}

	@OneToMany(mappedBy="TSupplier")
	@JoinColumn(name="SupplierID")
	public Set<TPurchase> getTPurchases() {
		return TPurchases;
	}

	public void setTPurchases(Set<TPurchase> tPurchases) {
		TPurchases = tPurchases;
	}
}
